# from selenium.webdriver.common.by import By
# from selenium.webdriver import Keys
# from selenium import webdriver
# from time import sleep
# from selenium.webdriver import ActionChains
# from selenium.webdriver.support.ui import Select
# # 创建ActionChains对象
# driver = webdriver.Chrome()
# driver.maximize_window()
# actions = ActionChains(driver)
# driver.get("http://www.baidu.com")
# sleep(4)
# element = driver.find_element(By.ID,'s-usersetting-top')
# element1 = driver.find_element(By.ID,'kw')
# element1.send_keys("艾薇儿")
# element1.send_keys(Keys.ENTER)
# # driver.find_element(By.ID,"su").click()
# sleep(3)
# actions.double_click().perform()
# actions.move_to_element(element1).perform()
# sleep(10)
# #######################
# source = driver.find_element(By.LINK_TEXT,'帮助')
# target = driver.find_element(By.XPATH,'//*[@id="goTop"]/li[8]')
# actions.drag_and_drop(source, target).perform()
# # js = "window.scrollTo(0,600)"
# # driver.execute_script(js)
# # sleep(5)
# # elementx = driver.find_elements(By.TAG_NAME,"input")
# # print(elementx)
# # for aa in elementx:
# #     if aa.get_attribute("id") == "kw":
# #         print("找到id为kw的元素了")
# #         aa.clear()
# #         aa.send_keys("心即理")
# #         driver.find_element(By.ID, "su").click()
# #         sleep(5)
# #         break
# # ActionChains(driver).move_to_element(elementx).perform()
# sleep(5)
# driver.close()
# driver.quit()
